<?php   
	// Interface function   
	function oh_module_simpletable($tokens) {
        global $oh_object_simpletable;
        return $oh_object_simpletable;        
	} 
	
	// Option file required
	//require_once($oh['path']."...");
	//require_once($oh['path']."...");
	
	// Main class of module
	class oh_class_simpletable { 
		public $attual_form;        
		public $row = "close";
		function oh_class_simpletable() {
		}
		function oh_object_simpletable() {
			global $oh_object_simpletable;
			return $oh_object_simpletable;
		}		
		function open($h="") {
			global $oh_object_simpletable;
			echo '<table class="ptable" cellspacing="0" cellpadding="2">';
				echo '<tr class="head">';
					$h = explode(",",$h);
					foreach($h as $i) {
						echo '<th>'.trim($i).'</th>';
					}
				echo '</tr>';
			return $oh_object_simpletable;
		}
		function close() {
			if ($this->row == "open") {
				echo '</tr>';
				$this->row = "close";
			}
			echo '</table>';
		}		
		function row($attr="") {
			global $oh_object_simpletable;
			if ($this->row == "open") {
				echo '</tr>';
				$this->row = "close";
			}
			echo '<tr '.$attr.'>';
			$this->row = "open";
			return $oh_object_simpletable;
		}
		function col() {
		}
		function cell($c,$attr) {
			global $oh_object_simpletable;
			echo '<td '.$attr.'>'.$c.'</td>';
			return $oh_object_simpletable;
		}
		function open_cell($attr) {
			global $oh_object_simpletable;
			echo '<td '.$attr.'>';
			return $oh_object_simpletable;		
		}
		function close_cell() {
			global $oh_object_simpletable;
			echo '</td>';
			return $oh_object_simpletable;
		}
	}
	
	// Main object of module
	global $oh_object_simpletable;
	$oh_object_simpletable = new oh_class_simpletable();
?>
